package com.taotao.job.rpc.server.example;


import com.taotao.job.rpc.core.invoker.Invoker;
import com.taotao.job.rpc.core.invoker.RemoteInvokerFactory;
import com.taotao.job.rpc.core.meta.IfaceMeta;
import com.taotao.job.rpc.core.proxy.CglibRpcProxyFactory;
import com.taotao.job.rpc.invoker.AbstractRemoteInvoker;
import com.taotao.job.rpc.invoker.caller.RemoteCaller;
import com.taotao.job.rpc.server.example.facade.ShopService;
import com.taotao.job.rpc.sofabolt.SofaboltRemoteCaller;

/**
 * 简单的consumer测试
 *
 * @author fanbeibei
 * @date 2020/10/31 15:15
 */
public class ClientExample {
    public static void main(String[] args) {


        //直接访问地址
        String address = "127.0.0.1:8888";

        ShopService shopService = new CglibRpcProxyFactory().newProxyInstance(ShopService.class, address);

//        RemoteCaller remoteCaller = new SofaboltRemoteCaller();
//        Invoker invoker = new RemoteInvokerFactory().newAddressedRemoteInvoker(address,remoteCaller);
//        ShopService shopService = new CglibRpcProxyFactory().newProxyInstance(ShopService.class, invoker);

        int num = shopService.reduceInventoryCount(1);

        System.out.println("***********" + num);

    }
}
